package study.datastructure.graph.criticalpath;/**
 * @program: datastructure
 * @author: lcy
 * @create: 2024-06-18 14:17
 */

/**
 2024/6/18,
 */


public class CriticalPathMethod {
    public static void main(String[] args) {
        Task a = new Task("A", 2);
        Task b = new Task("B", 3);
        Task c = new Task("C", 1);
        Task d = new Task("D", 4);
        Task e = new Task("E", 2);
        Task f = new Task("F", 3);

        b.addPredecessor(a);
        c.addPredecessor(b);
        d.addPredecessor(a);
        e.addPredecessor(d);
        f.addPredecessor(d);

        Project project = new Project();
        project.addTask(a);
        project.addTask(b);
        project.addTask(c);
        project.addTask(d);
        project.addTask(e);
        project.addTask(f);

        project.calculateCriticalPathMethod();
    }
}
